/*
 * ---------------------------------------------------------------------
 * Copyright (c) 2014, 2015 All Right Reserved
 * This software is developed for study and improve coding skill ...
 *
 * Project:  Excellent Coding < EC >
 *
 * ecMemOP.cpp
 * This file for all EC memory operation interface implementation.
 *
 * Eamil:   epengao@126.com
 * Author:  Peter Gao
 * Version: Intial first version.
 * --------------------------------------------------------------------
 */

#include <stdlib.h>
#include <string.h>
#include "ecMemOP.h"

namespace ec {

EC_PTR ecMemAlloc(EC_U32 uSize)
{
	return malloc(uSize);
}

EC_U32 ecMemFree(EC_PTR pMem)
{
	free(pMem);
	return EC_Err_None;
}

EC_U32 ecMemSet(EC_PTR pMem, EC_U32 uSize)
{
	memset(pMem, uSize, 1);
	return EC_Err_None;
}

EC_U32 ecMemCopy(EC_PTR pDest, EC_PTR pSrc, EC_U32 uSize)
{
	memcpy(pDest, pSrc, uSize);
	return EC_Err_None;
}

EC_S32 ecMemCompare(EC_PTR pBuf1, EC_PTR pBuf2, EC_U32 uSize)
{
	return memcmp(pBuf1, pBuf2, uSize);
}

EC_U32 ecMemMove(EC_PTR pDest, EC_PTR pSrc, EC_U32 uSize)
{
	memmove (pDest, pSrc, uSize);
	return EC_Err_None;
}
}/* namespace ec */